package day10.threadLocal.example;

import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingDeque;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/**
 * <>
 * <详细描述>
 *
 * @Author WANG.SONG.
 * @Date 2019/3/13 0013 23:34
 * @see
 */
public class SimpleThreadPool {


    private static BlockingQueue<Runnable> workQueue = new LinkedBlockingDeque<>();
    private static ThreadPoolExecutor executor = new ThreadPoolExecutor(2,
            3,
            1000,
            TimeUnit.MILLISECONDS,
            workQueue);

    public void doTask(Runnable runnable){
        executor.execute(runnable);
    }


}
